/**
 * $Id: editor_plugin_src.js 201 2007-02-12 15:56:56Z spocke $
 *
 * @author Moxiecode
 * @copyright Copyright c 2004-2008, Moxiecode Systems AB, All rights reserved.
 */

(function() {
	tinymce.create('tinymce.plugins.Enter', {
		init : function(ed, url) {
			var t = this;

			t.editor = ed;
			if(typeof parent.submitAjaxForm == 'function'){
				ed.onKeyDown.add(function(ed, e) {
					if (e.keyCode == 13 && !e.shiftKey) {
						parent.submitAjaxForm();
						tinymce.dom.Event.cancel(e);
					}
			        });
			}
			
		},

		getInfo : function() {
			return {
				longname : 'Enter press',
				author : 'ISS Art',
				authorurl : 'http://issart.com',
				version : tinymce.majorVersion + "." + tinymce.minorVersion
			};
		}

		// Private methods
	});

	// Register plugin
	tinymce.PluginManager.add('enter', tinymce.plugins.Enter);
})();